<template>
    <div>
        <el-drawer title="职责列表" :visible.sync="visible" close-on-press-escape direction="btt" size="70%">
            <!-- 表格表头 -->
            <div class="table-header">
                <div>
                    <!-- <el-button-group>
                    <el-button icon="el-icon-circle-plus-outline" size="small"
                        @click="selectUserDailog(userRoleForm.pkOrg,userRoleForm.roleId)">关联职责</el-button>
                    <el-button icon="el-icon-remove-outline" size="small" @click="deleteHandle()">删除职责</el-button>
                </el-button-group> -->
                </div>
                <div>
                    <el-button size="small" round icon="el-icon-refresh" @click="getRoleRespList()"></el-button>
                </div>
            </div>

            <el-table :data="userroleList" size="small" min-height="300" style="width: 100%" highlight-current-row>
                <el-table-column property="pkResponsibility" label="职责编号"></el-table-column>
                <el-table-column property="name" label="职责名称">
                </el-table-column>
                <el-table-column property="typeDesc" label="职责类型"></el-table-column>
                <el-table-column property="description" label="职责描述"></el-table-column>
                <el-table-column property="groupName" label="所属集团"></el-table-column>
                <el-table-column property="orgName" label="所属组织"></el-table-column>
                <el-table-column property="enabledate" label="有效期"></el-table-column>
                <el-table-column property="disabledate" label="失效期"></el-table-column>
                <div slot="empty">
                    <div class="avue-empty">
                        <div class="avue-empty__image" style="height: 50px;"><img
                                src=""
                                alt=""></div>
                        <p class="avue-empty__desc">暂无数据</p>
                    </div>
                </div>
            </el-table>
        </el-drawer>
    </div>

</template>
<script>
    import * as responsibilityService from '@/api/upms/responsibility'
    export default {
        data() {
            return {
                userRoleForm: {
                    roleId: ''
                },
                userroleList: [],
                visible: false,
            }
        },
        components: {},
        methods: {
            init(roleId) {
                if (roleId) {
                    this.visible = true
                    this.userRoleForm.roleId = roleId;
                    this.getRoleRespList()
                }
            },
            // 默认加载某个角色职责授权列表
            getRoleRespList() {
                responsibilityService.getresponsibilityselectedlist(this.userRoleForm.roleId).then(data => {
                    this.userroleList = data
                })
            },
        }
    }
</script>